<template>
	<div class="index show_box">
		<!-- <span style="position: absolute;right: 20px;top:15px;">修改></span> -->
			<el-tabs  v-model="activeName"  @tab-click="handleClick">
			<el-tab-pane  :label="$t('home.personalData')"  name="first">
			</el-tab-pane>
			<el-tab-pane  label="实名信息"  name="second">
			</el-tab-pane>
			<!-- <el-tab-pane  label="实名资料"  name="second">
			</el-tab-pane> -->
				<router-view></router-view>
		</el-tabs>
	</div>
</template>

<script>
	export default {
		data: function() {
			return {
				activeName:'',
				dataNews: [{
					title: 'xinwen',
					content: 'asdadasdasdasdasdasd',
					time: '2000-11-21',
					img: '',
					id:3
				},{
					title: 'xinwen2',
					content: 'asdadasqe1331dasdasdasdasd',
					time: '2000-11-22',
					img: '',
					id:4
				},{
					title: 'xinwen3',
					content: 'asdadwqwewqsdaccdaasdasdasdasdasd',
					time: '2000-11-21',
					img: '',
					id:323
				}, ],
				logotext:'进行中'
			};
		},
		components:{
		},
		methods: {
			handleClick(tab) {
				if(tab.index == 0){
					this.$router.push('/author/center/userInfo')
				}else if(tab.index == 1){
					this.$router.push('/author/center/userInfo/realInfo')
				}
				this.logotext = tab.label
				// this.getInfo(tab.lable)
			},
			toRealInfo(){
				this.$router.push({
						path:'./realInfo',
						query:{
						  id:rev
						}
					  })
			},
			toDetail(rev){
				this.$router.push({
				        path:'/activityDetail',
				        query:{
				          id:rev
				        }
				      })
			},
			getInfo(){
				
			},
			
			
		},
		beforeRouteLeave(to, from, next) {//离开拦截
			this.$confirm(this.$t('home.leavePageNotSave'), this.$t('home.warmPrompt'), {
			confirmButtonText: this.$t('home.whateverBye'),
			cancelButtonText: this.$t('home.meThink'),
			center: true,
			type: "warning",
			}).then(() => {
			next();
			});
		},
		created(){
			if(this.$route.path ==='/author/center/userInfo'){
				this.activeName = 'first'
			}else if(this.$route.path == '/author/center/userInfo/realInfo'||'/author/center/userInfo/changePhone'){
				this.activeName = 'second'
			}else{
			}
			// if(this.$router)
		},
		updated(){
		}
	}
</script>

<style lang="scss" scoped="scoped">
::v-deep .el-tabs__nav-wrap::after{
	height: 1px;
}
::v-deep .el-tabs__nav{
	padding: 10px 0;
}
::v-deep .el-tabs__active-bar{
	height: 1;
}
	::v-deep .el-tabs__item{
		font-size: 24px;
	}
	.content{
		display: flex;
		flex-direction: column;
		.liItem{
			display: flex;
			flex-direction: row;
			height: 120px;
			box-sizing: border-box;
			padding: 10px;
			border-bottom: 1px solid #ccc;
			margin: 10px 0;
			.left{
				display: flex;
				flex-direction: column;
				flex:1;
				.title{
					font-size: 16px;
					font-family: PingFangSC-Medium, PingFang SC;
					font-weight: 500;
					color: #333333;
					// line-height: 14px;

				}
				.context{
					font-size: 10px;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #666666;
					line-height: 12px;
					flex: 1;
				}
				.time{
					font-size: 8px;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #CCCCCC;
					line-height: 11px;

				}
			}
			.right{
				width: 100px;
				img{
					width: 100%;
				}
			}
		}
	}
.show_box{
	padding: 20px 40px;
    box-sizing: border-box;
}
</style>
